import 'package:flutter/material.dart';

//ListView列表组件
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('层叠布局 - Stack'),
          backgroundColor: Colors.pink[100],
        ),
        body: MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    //Row组件
    return Stack(
      alignment: Alignment.center,//配置所有子元素的显示位置
      children:[
        Container(
          width: 300,
          height: 400,
          color: Colors.yellow,
        ),
        Container(
          width: 100,
          height: 200,
          color: const Color.fromARGB(255, 255, 95, 59),
        ),
        Text('你好，牛哞哞'),
        Text('你好，2222222'),

      ],
    );
  }
}
